package com.sprint.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope  //alibaba自动刷新功能，无需后台curl刷新了
public class ConfigClientController {

    @Value("${config.info}")
    private String configinfo;

    @GetMapping("/config/info")
    public String getConfiginfo()
    {
        System.out.println("configinfo = " + configinfo);
        return configinfo;
    }

}
